<!DOCTYPE html>
<html>
    <head>
        <meta charset=utf-8>
    </head>
    <body>

        <script type="text/javascript">
            function _comma(number) {
                // 补全代码
                let b = number < 0 ? '-' : '';
                if (Math.abs(number) < 1000) {
                    return number.toString();
                } else {
                    number=Math.abs(number)
                    return b+_comma(Math.floor(number / 1000)) + "," + _comma(number % 1000);
                }
            }


        </script>
    </body>
</html>